use serde::{Deserialize, Serialize};

use crate::model::system_admin::SystemAdmin;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LoginVo {
    pub id: Option<u32>,
    pub nickname: Option<String>,
    pub account: Option<String>,
    pub permissions: Vec<String>,
    pub role_ids: Vec<String>,
    pub is_disable: Option<u8>,
    pub token: String,
}

impl From<SystemAdmin> for LoginVo {
    fn from(value: SystemAdmin) -> Self {
        Self {
            id: value.id,
            nickname: value.nickname,
            account: value.account,
            permissions: vec![],
            role_ids: vec![],
            is_disable: value.is_disable,
            token: "".to_string(),
        }
    }
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CaptchaVo {
    pub image: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TokenVo {
    pub token: Option<String>,
}
